Skip to content

Don't retry requests when you get 400 HTTP code#420

Merged
pshanbhag merged 1 commit intomasterfrom
private/pshanbhag/no-retry-on-400
Aug 7, 2025
Merged

Don't retry requests when you get 400 HTTP code#420
pshanbhag merged 1 commit intomasterfrom
private/pshanbhag/no-retry-on-400

Conversation

@pshanbhag
Copy link
Collaborator

@pshanbhag pshanbhag commented Jul 31, 2025

The CLI does implement a retry of HTTP requests for certain status codes. But retrying for 400 is incorrect. If there is such an API expecting retry on 400, it should be fixed to return a reasonable status code other than 400.

Summary by Bito

This pull request modifies the HTTP retry logic by removing HTTP 400 errors from retry conditions, ensuring only appropriate status codes trigger retries. The changes also include a minor documentation fix to correct a comment typo in the logger interface, improving both error handling robustness and code documentation clarity.

The CLI does implement a retry of HTTP requests for certain status codes. But
retrying for 400 is incorrect. If there is such an API expecting retry on 400,
it should be fixed to return a reasonable status code other than 400.
@bito-code-review
Copy link
Contributor

Changelist by Bito

This pull request implements the following key changes.

Key Change Files Impacted
Bug Fix - HTTP Retry Logic Correction

helper.go - Removed the check for http.StatusBadRequest from the retry conditions to ensure that 400 status codes are not retried, thereby correcting the logic for handling unsuccessful HTTP responses.

Documentation - Logger Comment Typo Correction

helper.go - Fixed a typographical error in the comment for the LeveledLogger interface, clarifying the intended implementation details.

Copy link
Contributor

@bito-code-review bito-code-review bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review Agent Run #5c4dd2

Actionable Suggestions - 1
  • pkg/util/helper.go - 1
    • Removed retry behavior for Bad Request responses · Line 72-72
Review Details
  • Files reviewed - 1 · Commit Range: 43c0389..43c0389
    • pkg/util/helper.go
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Default Agent You can customize the agent settings here or contact your Bito workspace admin at mithil@platform9.com.

Documentation & Help

AI Code Review powered by Bito Logo

@pshanbhag pshanbhag merged commit 8f50c2b into master Aug 7, 2025
5 checks passed
@pshanbhag pshanbhag deleted the private/pshanbhag/no-retry-on-400 branch August 7, 2025 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants